package com.daedalus.Polimorfizmi.Shapes;

import javax.swing.*;
import java.util.Random;


public class MAIN {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
	//	JFrame frame=new JFrame();

		String[] sh={"MyLine"};
		MyShape[] shapes=new MyShape[10];

		Random random=new Random();
		for(int i=0;i<10;i++){
			int choice=random.nextInt(3);
			if(choice==0)
				shapes[i]=new MyLine(10+random.nextInt(200),random.nextInt(200),10+random.nextInt(200),10+random.nextInt(200));
			if(choice==1)
				shapes[i]=new MyOval(10+random.nextInt(200),random.nextInt(200),10+random.nextInt(200),10+random.nextInt(200));
			if(choice==2)
				shapes[i]=new MyRectangle(10+random.nextInt(200),random.nextInt(200),10+random.nextInt(200),10+random.nextInt(200));
		}
		
		JFrame frame2 = new JFrame();
		frame2.setSize(600, 600);
		frame2.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
		frame2.setTitle("frame2");

		
		for(MyShape shape:shapes){
			frame2.add(shape);
		}
		frame2.setVisible(true);
	}

}
